<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv=content-type
        content="text/html; charset=UTF-8;charset=utf-8"/>
  <title>订单管理</title>
  <link rel="stylesheet" href="../css/index.css" type="text/css" media="screen" charset="utf-8"/>
  <link rel="stylesheet" href="../css/jquery-ui-1.8.14.custom.css" type="text/css" media="screen" charset="utf-8"/>
  <script type="text/javascript" src="../js/jquery-1.6.js"></script>
  <script type="text/javascript" src="../js/jquery-ui-1.8.14.custom.min.js"></script>
  <script type="text/javascript" src="../js/common.js"></script>
  <script type="text/javascript">
    alert("hello")
  </script>
  <script type="text/javascript">
    $(function() {
      $('#order_li').attr("class", "current");

      if ("<%=session.getAttribute("isWaiting")%>" == "1") {
        $('#waiting-tab').attr("class", "current");
      } else {
        $('#success-tab').attr("class", "current");
      }

      $("#dialog:ui-dialog").dialog("destroy");
      $("#dialog-add").dialog({
        autoOpen: false,
        height: 260,
        width: 520,
        modal: true,
        show: "clip",
        hide: "slide",
        buttons: {
          "确定": function() {
            $('#add-form :submit').click();
          },
          "关闭": function() {
            $(this).dialog('close');
          }
        }
      });
    });
  </script>
</head>
<body class="newbie">
<div id="pagemasker"></div>
<div id="dialog"></div>
<div id="doc">
  <jsp:include page="../common/adminHeader.jsp"/>
  <div id="bdw" class="bdw">
    <div id="bd" class="cf">
      <div id="coupons">
        <jsp:include page="../common/title/order_tab.jsp"/>
        <div id="content" class="coupons-box clear mainwide">
          <div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
              <div class="head">
                <h2>订单管理</h2>
              </div>
              <div class="sect">
                <table id="orders-list" cellspacing="0" cellpadding="0"
                       border="0" class="coupons-table">
                  <tr>
                    <th width="30">ID</th>
                    <th width="30">商品</th>
                    <th width="100">用户名</th>
                    <th width="60">数量</th>
                    <th width="60">总价</th>
                    <th width="100">附言</th>
                    <th width="200">下单时间</th>
                    <th width="100">状态</th>
                    <th width="40">操作</th>
                  </tr>

                  <s:iterator id="order" value="orderForms">
                    <tr class="alt" id="team-list-id-3">
                      <td>${order.id}</td>
                      <td>${order.itemId}</td>
                      <td>${order.user.username}</td>
                      <td>${order.number}</td>
                      <td>${order.price}</td>
                      <td>${order.message}</td>
                      <td>${order.orderTime}</td>
                      <td>
                        <s:if test="#order.status == 0">
                          <a onclick="return confirmOrder('是否确认订单？','/admin/acceptOrder.action?id=${order.id}');"
                             href="#"> <img src="../image/common/clock.png">等待处理</a>
                        </s:if>
                        <s:else>
                          订单交易成功
                        </s:else>
                      </td>
                      <td class="op">
                        <a onclick="return confirmDelete('确认删除订单号为${order.id}?<br><br>此操作无法恢复!',
														'/admin/deleteLink.action?id=${order.id}');" href="#"><img
                            src="../image/common/cross.png" alt="删除" title="删除"/></a>
                      </td>
                    </tr>
                  </s:iterator>
                  <tr>
                    <jsp:include page="../common/pager.jsp"/>
                  </tr>
                </table>

              </div>
            </div>
            <div class="box-bottom"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <jsp:include page="../common/footer.jsp"/>
</div>
</body>
</html>